import { Component, OnInit } from '@angular/core';
import { loginData } from 'src/app/date/logindate';
import { MeberRequstService } from 'src/app/services/meber-service.service';

@Component({
  selector: 'app-meberrequest',
  templateUrl: './meberrequest.component.html',
  styleUrls: ['./meberrequest.component.css']
})
export class MeberrequestComponent implements OnInit {

  constructor(private Meberrequst:MeberRequstService) { }

  public userName:loginData={user_name:''};
  
  requst(){
    this.Meberrequst.MeberRequst(this.userName).subscribe(
      data=>{
        console.log(data)
         if(data==true){
          alert("恭喜您申请会员成功")
        }else{
        alert("十分抱歉,由于您的注册时间未满一年无法申请会员,请您谅解")
        }
    }
    );
  }

  ngOnInit(): void {
  }



}
